<?php
namespace app\admin\controller;
use think\Controller;
use think\Db;
class Order extends Common
{
	//订单明细列表
	public function index(){
		$all = input('get.all');
		$key = input('get.key');
		 $money = DB::table('ma_order')->alias('a')->join('ma_users b','a.uid = b.uid')->field('b.username,SUM(a.money) as moneys,SUM(a.winmoney) as winmoneys')->where('b.username|a.qishu','like',"%".$key."%")->order('oid desc')->select();
		$moneys = round($money[0]['moneys'],2);
		$winmoneys = round($money[0]['winmoneys'],2);
		$data = model('Order')->index();
		$this->assign('all',$all);
		$this->assign('data',$data);
		$this->assign('moneys',$moneys);
		$this->assign('winmoneys',$winmoneys);
		return $this->fetch();
	}
}